-
Notifications
You must be signed in to change notification settings - Fork 390
refactor!: Implement generics for CheckPoint
, LocalChain
, and spk_client
types
#1582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
CheckPoint
takes a genericCheckPoint
and LocalChain
a899049
to
7c13781
Compare
7c13781
to
d934a6c
Compare
ea1cf8b
to
bf90ea5
Compare
c278804
to
6300d7c
Compare
CheckPoint
and LocalChain
CheckPoint
, LocalChain
, and spk_client
types
6300d7c
to
315f687
Compare
765d584
to
7488001
Compare
7488001
to
d22c61f
Compare
+1 for this feature, |
At a high level I think the API would be cleaner if the generic methods had the simpler names (new, push, extend, insert) and the old methods were renamed
fn data_ref(&self) -> &B {}
fn data(&self) -> B where B: Clone {} // or Copy
Remaining questions:
Edit: I added my review with some API suggestions in LagginTimes#5 |
d22c61f
to
5acf81b
Compare
5acf81b
to
4148e29
Compare
@LagginTimes is this ready to review again? Remember to mark it as so and request reviewers, otherwise no one will know about it. |
3d7f48c
to
69d8643
Compare
What was the discussion around breaking changes? Were we okay to break the API? |
CheckPoint
, LocalChain
, and spk_client
typesCheckPoint
, LocalChain
, and spk_client
types
Iirc the consensus was for this to be a breaking change to be a cleaner API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pushing this forward.
Please double check (brownie points for triple check) over all the methods of a struct to see whether they are coherent, whether any more methods can be made generic and whether the method names and generic parameter names are coherent and make sense.
Let's make all generic parameter names for block data be consistent across the board. I'm in favor of B
.
585f35f
to
e894c73
Compare
e894c73
to
f135eb0
Compare
f135eb0
to
7699737
Compare
Implements #1937.
Description
This PR is a step towards header checkpointing for
bdk_electrum
. The goal is to be able to store whole headers inCheckPoint
so they do not have to be re-downloaded. Storing headers this way would be a prerequisite for caching of merkle proofs and for median time passed.Notes to the reviewers
Changelog notice
CheckPoint
takes in a generic.LocalChain
andChangeSet
take in generics.spk_client
types can take in generics.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing